package com.ruoyi.dynamic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.dynamic.mapper.RoomVoteMusicRecordMapper;
import com.ruoyi.dynamic.model.pojo.entity.RoomVoteMusicRecord;
import com.ruoyi.dynamic.service.IRoomVoteMusicRecordService;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 * 房间歌曲投票记录 服务实现类
 * </p>
 *
 * @author Gnc
 * @since 2025-01-07
 */
@Service
public class RoomVoteMusicRecordServiceImpl extends ServiceImpl<RoomVoteMusicRecordMapper, RoomVoteMusicRecord> implements IRoomVoteMusicRecordService {

    @Override
    public void addRecord(Long roomId, Long id, Long resourceId, Long userId) {
        RoomVoteMusicRecord record = new RoomVoteMusicRecord();
        record.setResourceId(resourceId);
        record.setUserId(userId);
        record.setRoomId(roomId);
        record.setVoteMusicId(id);
        record.setCreateTime(new Date());
        save(record);
    }
}
